package Calendar;

import java.util.Calendar;

/**
 * ClassName:CalendarTest
 * Package:Calendar
 * Description
 *
 * @Author:@wenxueshi
 * @Create:2023/7/22 - 16:35
 * @Version:v1.0
 */
public class CalendarTest {

    public static void main(String[] args) {
        //获取Calendar实例
        Calendar cal = Calendar.getInstance();
        //获取年、月、日、时、分、秒
        System.out.println(cal.get(Calendar.YEAR));
        System.out.println(cal.get(Calendar.MONTH) + 1);
        System.out.println(cal.get(Calendar.DAY_OF_MONTH));
        System.out.println(cal.get(Calendar.HOUR_OF_DAY));
        System.out.println(cal.get(Calendar.MINUTE));
        System.out.println(cal.get(Calendar.SECOND));
    }
}
